package com.wangsong.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.annotation.Resource;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wangsong.model.User;




@Controller
public class MUserController {
	
	 /**
     * spring消息发送模版
     */
    @Resource(name="queueJmsTemplate")
    private JmsTemplate jmsTemplate;

    /**
     * 消息目的地
     */
    @Resource(name = "queueDestination")
    private Queue defaultDestination;
	
	@RequestMapping(value="/mq")
	@ResponseBody
	public String listUser(HttpServletRequest request,User user) {
		jmsTemplate.convertAndSend(this.defaultDestination, user);
		
		return "";
	}
	 
	
	
}
